<script type="text/javascript" src="/public/library/jquery/jquery.form.js"></script>
<script src="/public/library/hvn/place.js" type="text/javascript"></script>
<script src="/public/library/hvn/event.search.js" type="text/javascript"></script>
<script src="/public/library/hvn/tour.js" type="text/javascript"></script>
<script src="/public/library/jquery/thickbox/jquery.DOMWindow.js" type="text/javascript"></script>
<link type="text/css" href="/public/library/jquery/calendar/excite-bike/ui.all.css" rel="stylesheet" media="screen" />
<link rel="stylesheet" href="/public/library/jquery/calendar/excite-bike/jquery-ui-1.7.1.custom.css" type="text/css" media="screen" />

<script type="text/javascript" src="/public/library/jquery/calendar/amlich.js"></script>
<script type="text/javascript" src="/public/library/jquery/calendar/ui.core.js"></script>
<script type="text/javascript" src="/public/library/jquery/calendar/ui.datepicker.js"></script>
<script type="text/javascript" src="/public/library/jquery/calendar/ui.datepicker-lang.js"></script>

<script type="text/javascript" >
	$(function(){
		//check value
		$("#form_tour_search").submit(function(){
		    if ($("#price").val() > $("#to_price").val() || $("#departure_date").val() > $("#return_date").val()
		    	|| $("#duration_start").val() > $("#duration_finish").val())
		    {
		        alert("wrong fee range!");
		        return false;
		    }
		    else
		        return true;
		});
		
        getType();
	});
     
    //populate without ZendForm   
    function populate_category_checkboxes()
    {
            <?if(!empty($this->type)):?>
            <?foreach ($this->type as $t) :?>
                    $("input:checkbox[name=type[]]").filter("[value=<?=$t?>]").trigger("click");
            <?endforeach?>
            <?endif?>
    }
</script>


<h1 style="padding-left:10px;padding-top:20px"> <?=t(840) ?> </h1>
<br/>
<div class="box_places_view_search" align="center">
<form id = "form_tour_search" accept-charset="UTF-8" action="<?= $this->escape($this->form->getAction()) ?>"
      method="<?= $this->escape($this->form->getMethod()) ?>">
<table class="full-search-box"> 
<tr>
	<td width="100px"><?=t(810) ?></td>
	<td width="220px" ><?=$this->form->name ?></td>
</tr>
<tr>
	<td width="100px"><?=t(816) ?></td>
	<td width="220px" ><?=$this->form->category_tour?></td>
</tr>
<tr>
	<td></td>
	<td id="sub-type">
 	</td>
</tr>
<tr>
	<td width="100px"><?=t(818) ?></td>
	<td width="220px" ><?=$this->form->departure_date ?></td>
	<td width="100px"><?=t(815) ?></td>
	<td width="220px" ><?=$this->form->return_date?></td>
</tr>
</table>
<h3 style="padding-left:10px;margin-bottom:0px"> <?=t(811) ?> </h3>

<table class="full-search-box"> 
<tr>
	<td width="100px"><?=t(17) ?></td>
	<td width="220px" ><?=$this->form->price ?></td>
	<td width="100px"><?=t(18) ?></td>
	<td width="220px" ><?=$this->form->to_price?>
	</td>
</tr>
<tr>
	<td width="100px"><?=t(812) ?></td>
	<td width="220px" ><?=$this->form->price_currency ?></td>
	<td width="100px"></td>
	<td width="220px" ></td>
</tr>
</table>

<!-- 
<?=t(819) ?>:<?=$this->form->duration_start?>  <?=t(18) ?>:<?=$this->form->duration_finish?> (hours)
<br/>

<h3 style="color:green;padding-left:10px"> Admin search options </h3>
<?if(isset($this->form->poster_id)):?>
<?=t(83) ?>  :<?=$this->form->poster_id?>
<?endif?> 
<?=t(2) ?> :<?=$this->form->status?>
<?=t(820) ?> :<?=$this->form->tours_per_page?>
-->
<div style="text-align:right;padding:20px 50px 30px 0px">
	<?=$this->form->submit ?>
</div>
</form>  
</div>    
<script>
$(function(){
	$("#category_tour").trigger("change");
});
</script>